﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.MapEvents.SiegeAmbushEventComponent
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.CampaignSystem.Party;

#nullable disable
namespace TaleWorlds.CampaignSystem.MapEvents
{
  public class SiegeAmbushEventComponent : MapEventComponent
  {
    internal static void AutoGeneratedStaticCollectObjectsSiegeAmbushEventComponent(
      object o,
      List<object> collectedObjects)
    {
      ((MapEventComponent) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    public SiegeAmbushEventComponent(MapEvent mapEvent)
      : base(mapEvent)
    {
    }

    public static SiegeAmbushEventComponent CreateSiegeAmbushEvent(
      PartyBase attackerParty,
      PartyBase defenderParty)
    {
      MapEvent mapEvent = new MapEvent();
      SiegeAmbushEventComponent component = new SiegeAmbushEventComponent(mapEvent);
      mapEvent.Initialize(attackerParty, defenderParty, (MapEventComponent) component);
      Campaign.Current.MapEventManager.OnMapEventCreated(mapEvent);
      return component;
    }

    protected override void OnFinalize() => this.MapEvent.ApplyRenownAndInfluenceChanges();
  }
}
